package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PmsSkuMapper;
import com.ruoyi.system.domain.PmsSku;
import com.ruoyi.system.service.IPmsSkuService;

/**
 * 商品库存Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-27
 */
@Service
public class PmsSkuServiceImpl implements IPmsSkuService 
{
    @Autowired
    private PmsSkuMapper pmsSkuMapper;

    /**
     * 查询商品库存
     * 
     * @param id 商品库存主键
     * @return 商品库存
     */
    @Override
    public PmsSku selectPmsSkuById(Long id)
    {
        return pmsSkuMapper.selectPmsSkuById(id);
    }

    /**
     * 查询商品库存列表
     * 
     * @param pmsSku 商品库存
     * @return 商品库存
     */
    @Override
    public List<PmsSku> selectPmsSkuList(PmsSku pmsSku)
    {
        return pmsSkuMapper.selectPmsSkuList(pmsSku);
    }

    /**
     * 新增商品库存
     * 
     * @param pmsSku 商品库存
     * @return 结果
     */
    @Override
    public int insertPmsSku(PmsSku pmsSku)
    {
        pmsSku.setCreateTime(DateUtils.getNowDate());
        return pmsSkuMapper.insertPmsSku(pmsSku);
    }

    /**
     * 修改商品库存
     * 
     * @param pmsSku 商品库存
     * @return 结果
     */
    @Override
    public int updatePmsSku(PmsSku pmsSku)
    {
        pmsSku.setUpdateTime(DateUtils.getNowDate());
        return pmsSkuMapper.updatePmsSku(pmsSku);
    }

    /**
     * 批量删除商品库存
     * 
     * @param ids 需要删除的商品库存主键
     * @return 结果
     */
    @Override
    public int deletePmsSkuByIds(Long[] ids)
    {
        return pmsSkuMapper.deletePmsSkuByIds(ids);
    }

    /**
     * 删除商品库存信息
     * 
     * @param id 商品库存主键
     * @return 结果
     */
    @Override
    public int deletePmsSkuById(Long id)
    {
        return pmsSkuMapper.deletePmsSkuById(id);
    }
}
